package com.crm.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="purchaseorder")
public class PO implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")
	@Column(name="id")
	private int id;
	
	@Column(name="enq_id")
	private int enquiryId;
	
	@Column(name="supp_id")
	private int supplierId;
	
	@Column(name="part_id")
	private int partId;
	
	@Column(name="src_id")
	private int sourceId;
	
	@Column(name="qty")
	private int quantity;
	
	@Column(name="unit_price")
	private float unitPrice;
	
	@Column(name="sum")
	private float sum;
	
	@Column(name="moq")
	private int moq;
	
	@Column(name="spq")
	private int spq;
	
	@Column(name="tot_price")
	private int totalPrice;
	
	
	private String remarks;
	
	@Column(name="po_number")
	private String poNumber;
	
	@Column(name="sup_ref_no")
	private String supplierRefNo;
	
	@ManyToOne
	@JoinColumn(name="BUSINESS_ID")
	private Business businessId;
	
	private Date date;
	
	public PO(){
		
	}
	public PO(int enquiryId, int partid, int quantity, int sourceId, int supplierId,
			float unitPrice, float sum, int moq, int total, Business businessId,
			Date currentDate, String supplierRefNo, String poNo) {
		this.enquiryId=enquiryId;
		this.partId=partid;
		this.quantity=quantity;
		this.sourceId=sourceId;
		this.supplierId=supplierId;
		this.unitPrice=unitPrice;
		this.sum=sum;
		this.moq=moq;
		this.totalPrice=total;
		this.businessId=businessId;
		this.date=currentDate;
		this.supplierRefNo=supplierRefNo;
		this.poNumber=poNo;
	}
	public Business getBusinessId() {
		return businessId;
	}
	public void setBusinessId(Business businessId) {
		this.businessId = businessId;
	}
	public String getRemarks() {
		return remarks;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	public int getSourceId() {
		return sourceId;
	}
	public void setSourceId(int sourceId) {
		this.sourceId = sourceId;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getEnquiryId() {
		return enquiryId;
	}
	public void setEnquiryId(int enquiryId) {
		this.enquiryId = enquiryId;
	}
	public int getSupplierId() {
		return supplierId;
	}
	public void setSupplierId(int supplierId) {
		this.supplierId = supplierId;
	}
	public int getPartId() {
		return partId;
	}
	public void setPartId(int partId) {
		this.partId = partId;
	}
	public int getQty() {
		return quantity;
	}
	public void setQty(int qty) {
		this.quantity = qty;
	}
	public float getUnitPrice() {
		return unitPrice;
	}
	public void setUnitPrice(float unitPrice) {
		this.unitPrice = unitPrice;
	}
	public float getSum() {
		return sum;
	}
	public void setSum(float sum) {
		this.sum = sum;
	}
	public int getMoq() {
		return moq;
	}
	public void setMoq(int moq) {
		this.moq = moq;
	}
	public int getSpq() {
		return spq;
	}
	public void setSpq(int spq) {
		this.spq = spq;
	}
	public int getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(int totalPrice) {
		this.totalPrice = totalPrice;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public String getPoNumber() {
		return poNumber;
	}
	public void setPoNumber(String poNumber) {
		this.poNumber = poNumber;
	}
	public String getSupplierRefNo() {
		return supplierRefNo;
	}
	public void setSupplierRefNo(String supplierRefNo) {
		this.supplierRefNo = supplierRefNo;
	}

}
